<template>
  <div id="app">
    <h1>app</h1>
    <son
      :class="box1"
      :msg="msg"
      :info="info"
      :obj="obj"
      @chaochao="chaochao"
      v-on:zhuangzhuang="zhuangzhuang"
    ></son>
  </div>
</template>

<script>
/* 
$attrs 父传子
注意：当props接收过后，this.$attrs就不能访问到

props $emit自定义事件 eventBus pubsub-js  ref $parant $children (provide inject) $attrs $listeners 插槽

父传子 props $parant(类型对象) $attrs $listeners 无名插槽 具名插槽
子传父 $emit自定义事件 ref  $children(数组) 作用域插槽
任意组件传值  eventBus pubsub-js
父级向子级传值 provide inject


*/
import Son from "./components/Son.vue";
export default {
  name: "App",
  data() {
    return {
      msg: "青花瓷",
      info: "中彩票，中了一千万",
      obj: {
        name: "tom",
        age: 18,
      },
      box1: ".box1",
    };
  },
  components: {
    Son,
  },
  methods: {
    chaochao() {
      console.log("超超很可爱！！");
    },
    zhuangzhuang() {
      console.log("我们的班长");
    },
  },
};
</script>

<style lang="scss" scoped>
</style>
